<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCWeb.Models.ViewData.DocumentNewViewData>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Create Legistrative Updates</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function() {
            $("#DocumentForm").validate({
                rules: {
                    Name: {
                        required: true
                    },
                    FullPath: {
                        required: true
                    }

                },
                messages: {
                    Name: {
                        required: "Name cannot be blank"
                    },
                    FullPath: {
                        required: "File cannot be blank"
                    }
                }
            });
        });
    </script>



    <%= Html.ValidationSummary() %>
    <% using (Html.BeginForm("CreateLegistrativeDoc", "Doc", FormMethod.Post, new { id = "DocumentForm", enctype = "multipart/form-data" }))
       {%>
    <fieldset>
        <legend>Create Legistrative Updates</legend>
        <p>
            <label for="Name">
                Document Name:</label>
            <%= Html.TextBox("Name", ViewData.Model.Document.Name) %>
            <%= Html.ValidationMessage("Name", "*") %>
        </p>
        <p>
            <label for="Desc">
                Description:</label>
            <%= Html.TextBox("Desc", ViewData.Model.Document.Desc) %>
            <%= Html.ValidationMessage("Desc", "*") %>
        </p>
        <p>
            <label for="FullPath">
                Filename:</label>
            <input type="file" name="FullPath" id="FullPath" size="40" />
            <%= Html.ValidationMessage("FullPath", "*") %>
        </p>
        <p>
            <label for="UserId">
                Category:</label>
            <%= Html.DropDownList("CategoryId", new SelectList(ViewData.Model.Categories, "DocCategoryId", "Category", "1"), new { style = "width: 200px; disabled", disabled = "disabled" })%>
            <%= Html.ValidationMessage("UserId", "*")%>
        </p>
        <br />
        <p>
            <input type="submit" value="Save" />
            <input type="reset" value="Reset" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%=Html.ActionLink("Go back", "Index") %>
    </div>
</asp:Content>

